package com.yonyou.isv.demo.openapi.mobile.controller;

import com.alibaba.fastjson.JSON;
import com.yonyou.isv.demo.openapi.mobile.service.MobileApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @author nishch
 * @description: TODO
 * @date 2021/9/17
 */
@Slf4j
@RestController
@RequestMapping("/bill")
public class MobileController {

    @Resource
    MobileApi mobileApi;

    @GetMapping("/getYonYouYhtCode")
    public void executeFormulaCalculate(@RequestParam String code,@RequestParam String tenantId) {
        Map<String,String> params = new HashMap<>();
        params.put("code",code);
        mobileApi.getProperties().setTenantId(tenantId);
        Map<String, Object> resultInfo = mobileApi.getInfoByCode(params);
        log.info(JSON.toJSONString(resultInfo));
    }
}
